<?php
$news = new Models_News();
$tagsContent = new Models_Tags();
$articleContent = new Models_Articles();
$content = new Models_Tags();
$articles = $content->getArticlesByTag($id);
foreach ($articles as $value)
{
     $body = $news->getMiniature($value['body'], 500);
     $body = strip_tags($body);
     $tags = $tagsContent->getArticleTags($value['id']);
     $countComment = $articleContent->countComment($value['id']);
    ?>
        <div class="well">
            <h4><a href="/<?php $content->printPath(); ?>articles/show/<?php echo $value['id']; ?>"><?php echo $value['title']; ?></a></h4>
            <?php echo $body; ?>
            <hr />
            <p class="" style="padding: 1px 1px; margin: -5px 0;;">
                   <i class="icon-calendar"></i> <?php echo $value['modified']; ?>
                  | <span class="label label-success"><i class="icon-comment icon-white"></i> <?php echo $countComment['count(id)']; ?></span>
                  | <i class="icon-tags"></i> Tags: 
                  <?php
                       foreach ($tags as $tag)
                       {
                           echo '<a href="/' . $tagsContent->path . 'articles/tag/' . $tag['id'] . '"><span class="label label-info">' . $tag['name'] . '</span></a> ';
                       }
                   ?>
            </p>
        </div>   
     <?php
}
?>